package com.ly.heart.service.impl;

import java.util.List;
import com.ly.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ly.heart.mapper.ProjectTypeEntityMapper;
import com.ly.heart.domain.ProjectTypeEntity;
import com.ly.heart.service.IProjectTypeEntityService;

/**
 * 项目类型Service业务层处理
 *
 * @author cxl
 * @date 2024-05-14
 */
@Service
public class ProjectTypeEntityServiceImpl implements IProjectTypeEntityService
{
    @Autowired
    private ProjectTypeEntityMapper projectTypeEntityMapper;

    /**
     * 查询项目类型
     *
     * @param id 项目类型主键
     * @return 项目类型
     */
    @Override
    public ProjectTypeEntity selectProjectTypeEntityById(String id)
    {
        return projectTypeEntityMapper.selectProjectTypeEntityById(id);
    }

    /**
     * 查询项目类型列表
     *
     * @param projectTypeEntity 项目类型
     * @return 项目类型
     */
    @Override
    public List<ProjectTypeEntity> selectProjectTypeEntityList(ProjectTypeEntity projectTypeEntity)
    {
        return projectTypeEntityMapper.selectProjectTypeEntityList(projectTypeEntity);
    }

    /**
     * 新增项目类型
     *
     * @param projectTypeEntity 项目类型
     * @return 结果
     */
    @Override
    public int insertProjectTypeEntity(ProjectTypeEntity projectTypeEntity)
    {
        projectTypeEntity.setCreateTime(DateUtils.getNowDate());
        return projectTypeEntityMapper.insertProjectTypeEntity(projectTypeEntity);
    }

    /**
     * 修改项目类型
     *
     * @param projectTypeEntity 项目类型
     * @return 结果
     */
    @Override
    public int updateProjectTypeEntity(ProjectTypeEntity projectTypeEntity)
    {
        return projectTypeEntityMapper.updateProjectTypeEntity(projectTypeEntity);
    }

    /**
     * 批量删除项目类型
     *
     * @param ids 需要删除的项目类型主键
     * @return 结果
     */
    @Override
    public int deleteProjectTypeEntityByIds(String[] ids)
    {
        return projectTypeEntityMapper.deleteProjectTypeEntityByIds(ids);
    }

    /**
     * 删除项目类型信息
     *
     * @param id 项目类型主键
     * @return 结果
     */
    @Override
    public int deleteProjectTypeEntityById(String id)
    {
        return projectTypeEntityMapper.deleteProjectTypeEntityById(id);
    }
}
